<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

    function fn(x,y){
      let sum = 0
      for(let i = x;i<=y;i++){
        sum += i
      }
      document.write(sum)
    }
  // fn(50,100)

  // let a = +prompt('1')
  // let b = +prompt('2')
  // fn(a,b)

  fn(+prompt('1'),+prompt('2'))

  </script>
</body>
</html>